//
//  UIImage+TAMessageBubble.m
//  triphare
//
//  Created by 李小盆 on 14/12/1.
//  Copyright (c) 2014年 ___LOTTO___. All rights reserved.
//

#import "UIImage+TAMessageBubble.h"

@implementation UIImage (TAMessageBubble)

- (UIImage *)makeStretchableIncoming
{
//    return [self resizableImageWithCapInsets:UIEdgeInsetsMake((self.size.height + BUBBLE_TAIL_HEIGHT)/2, BUBBLE_CORNER_RADIUS + BUBBLE_TAIL_WIDTH, BUBBLE_CORNER_RADIUS, BUBBLE_CORNER_RADIUS)
//                                resizingMode:UIImageResizingModeStretch];
    
    return [self resizableImageWithCapInsets:UIEdgeInsetsMake((self.size.height)/2 + 6, 20, 10, 15)
                                resizingMode:UIImageResizingModeStretch];
}

- (UIImage *)makeStretchableOutgoing
{
//    return [self resizableImageWithCapInsets:UIEdgeInsetsMake((self.size.height + BUBBLE_TAIL_HEIGHT)/2, BUBBLE_CORNER_RADIUS, BUBBLE_CORNER_RADIUS, BUBBLE_CORNER_RADIUS + BUBBLE_TAIL_WIDTH)
//                                resizingMode:UIImageResizingModeStretch];
    
    return [self resizableImageWithCapInsets:UIEdgeInsetsMake((self.size.height)/2 + 6, 10, 10, 20)
                                resizingMode:UIImageResizingModeStretch];
}

+ (UIImage *)bubbleIncoming
{
    return [[UIImage imageNamed:@"bubble_incoming"] makeStretchableIncoming];
}

+ (UIImage *)bubbleIncomingSelected
{
    return [[UIImage imageNamed:@"bubble_incoming_selected"] makeStretchableIncoming];
}

+ (UIImage *)bubbleOutgoing
{
    return [[UIImage imageNamed:@"bubble_outgoing"] makeStretchableOutgoing];
}

+ (UIImage *)bubbleOutgoingSelected
{
    return [[UIImage imageNamed:@"bubble_outgoing_selected"] makeStretchableOutgoing];
}

@end
